package com.study.ming.shejimoshi.observe;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Changer {
	
	private int state; 
	private List<AbstractObserve> observes = new ArrayList();

	public void bindObserve(AbstractObserve observe) {
		observes.add(observe);
	}
	public void unbindObserve() {
		observes.clear();
	}
	
	
	public void changState(int state) {
		this.state = state;
		noitfyAll();
	}
	public void noitfyAll() {
		for (int i = 0; i < observes.size(); i++) {
			AbstractObserve observe = observes.get(i);
			observe.update();
		}
	}
}
